home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / searchtools / dist / oasisIII.idb / etc / init.d / okserver.z / okserver
Text File  |  1996-11-11  |  3KB  |  84 lines

  1. #!/bin/sh
  2. #
  3. # Start and stop oksvr(1M)
  4. #
  5. # Copyright 1988-1991 Silicon Graphics, Inc.
  6. # All rights reserved.
  7. #
  8. # This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  9. # the contents of this file may not be disclosed to third parties, copied or
  10. # duplicated in any form, in whole or in part, without the prior written
  11. # permission of Silicon Graphics, Inc.
  12. #
  13. # RESTRICTED RIGHTS LEGEND:
  14. # Use, duplication or disclosure by the Government is subject to restrictions
  15. # as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  16. # and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  17. # successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  18. # rights reserved under the Copyright Laws of the United States.
  19. #
  20. # $Revision: 1.3 $
  21.  
  22. #       This is the oksvr /etc/init.d/okserver startup script for
  23. #       The Developer Toolbox, version 5.0 CD, released, March 1995.
  24. #       The key to running this script correctly is to always ensure 
  25. #       that the
  26. #
  27. #            OKSVR_ROOT
  28. #
  29. #       shell variable is defined to point to the absolute path location 
  30. #       where the "searchtools" directory exists.  By default this
  31. #       location is defined to be  "/CDROM/searchtools".  If one is
  32. #       running an HTTP server and wants to create a child directory 
  33. #       of the HTTP server's Document Root to place the contents of
  34. #       this toolbox in, the OKSVR_ROOT variable will need to be 
  35. #       redefined to properly point to the new "active" location of 
  36. #       "searchtools".  For example, suppose the HTTP server's 
  37. #       Document Root is "/usr/local/www", and a directory under this
  38. #       named "toolbox" is created to house the contents of the v5.0
  39. #       CD.  Then, the default OKSVR_ROOT definition would change from,
  40. #
  41. #            OKSVR_ROOT=/CDROM/searchtools
  42. #
  43. #       to now be,
  44. #
  45. #            OKSVR_ROOT=/usr/local/www/toolbox/searchtools
  46. #
  47.  
  48. IS_ON=/etc/chkconfig
  49. OKSVR=/usr/sbin/oksvr
  50. RM=/bin/rm
  51. GREP=/bin/grep
  52. ECHO=/bin/echo
  53. PS=/bin/ps
  54. OKSVR_ROOT=/CDROM/searchtools
  55.  
  56. case $1 in
  57. 'start')
  58.     if $IS_ON okserver && test -x /usr/sbin/oksvr; then
  59.      if $PS -e 2>/dev/null | $GREP oksvr > /dev/null 2>&1 ; then
  60.             $ECHO "OasisIII Search Server (oksvr) already running."
  61.             exit 1
  62.      else
  63.             if test -d $OKSVR_ROOT; then
  64.         $ECHO "OasisIII Search Server: oksvr started"
  65.         /bin/su root -c "env FULPATH=$OKSVR_ROOT $OKSVR &"
  66.             else
  67.         $ECHO "Error:  oksvr:  cannot locate Developer Toolbox Database"
  68.                 $ECHO "Please see sifttree.README at top-of-tree v5.0 Developer Toolbox CD"
  69.         fi
  70.      fi
  71.     fi
  72. ;;
  73.  
  74. 'stop')
  75.     killall -QUIT oksvr    # send signal to kill
  76.     $RM -rf /usr/tmp/ft*    # get rid of temp files
  77.     $ECHO "OasisIII Search Server: oksvr stopped"
  78.     ;;
  79.  
  80. *)
  81.     echo "usage: $0 {start|stop}"
  82.     ;;
  83. esac
  84.